package com.five.author.mapper;

import com.five.Page.Page;
import com.five.pojo.Novel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component("userNovelMapper")
public interface NovelMapper {

    void insert(Novel novel);

    void deleteById(Long id);

    void updateById(Novel novel);

    Novel selectById(Long id);

    List<Novel> selectByPage(Page<Novel> page);

    Integer selectTotals();

    List<Novel> selectAll();

    /**
     * 根据作者id查询他的小说
     * @param authorId
     * @return
     */
    List<Novel> selectByAuthorId(Long authorId);

    /**
     * 根据小说id修改小说状态
     * @param id
     */
    void updateStatusById(@Param("ids") List<Long> id,@Param("status") int status);
}